package com.itheima.service.Impl;

import com.alibaba.dubbo.config.annotation.Service;
import com.itheima.dao.UserDao;
import com.itheima.pojo.User;
import com.itheima.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.transaction.annotation.Transactional;
//*
// 用户服务
// */
@Service(interfaceClass = UserService.class)
@Transactional


public class UserserviceImpl implements UserService {
    @Autowired
    private UserDao userDao;
    @Autowired
    private RoleDao roleDao;
    //根据用户名查询数据库获取用户信息和关联的角色信息，还需查询角色信息关联的权限信息
    public User findByUsername(String username) {
        User user = userDao.findByUsername(username);
        if (user == null){
            return null;
        }
        Integer userId = user.getId();
        //根据用户Id查询对应的角色

        return null;
    }
}
